package com.neo.scalaCookBook.C1_String

/**
  * Autuor : zhaoshun
  * Time   : 2017/10/17 22:19
  * Email  : tmby1314@163.com  
  */

/**
  *  字符串中查找模式
  */
object FindModFromStrings {

  def main(args: Array[String]): Unit = {
    val numPattern = "[0-9]+".r
    println(numPattern)

    val address = "123 main Street suite 101"

    val mach1 = numPattern.findFirstIn(address)
    println(mach1)

    val mach2 = numPattern.findAllIn(address)
    mach2.foreach(println)


    val mach3 = numPattern.findAllIn(address).toArray
    for(i <- mach3) println(i)
  }

}
